package com.gitee.wsl.common.ui.ext.shape

import androidx.compose.foundation.shape.AbsoluteCutCornerShape
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Outline
import androidx.compose.ui.graphics.Path
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.LayoutDirection
import com.gitee.wsl.common.ui.ext.path.triangle


/**
 * A shape describing a triangle.
 */
val Shapes.TriangleShape: Shape
    get() = object : Shape {
        override fun createOutline(size: Size, layoutDirection: LayoutDirection, density: Density) =
            Outline.Generic(Path().apply { triangle(size) })

        override fun toString(): String = "TriangleShape"
    }

/**
 * A shape describing a diamond.
 */
val Shapes.DiamondShape: Shape
    get() = AbsoluteCutCornerShape(50)
